Conversation
…unit tests for API, Git, Config, and LLM components.
|
@codex review this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2c63b4f62
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| s := bufio.NewScanner(os.Stdin) | ||
| for s.Scan() { | ||
| line := s.Bytes() | ||
| var req rpcReq | ||
| if err := json.Unmarshal(line, &req); err != nil { |
There was a problem hiding this comment.
Parse MCP stdio frames instead of newline-delimited JSON
This server reads stdin with bufio.Scanner and attempts to json.Unmarshal each line as a complete request, but MCP stdio clients send framed messages (header lines plus JSON body), not one-JSON-object-per-line. As a result, normal MCP traffic is discarded before dispatch, so serve-mcp cannot interoperate with standard MCP clients.
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| func (g *GitExtractor) GetCommitDiff(commit1 string, commit2 string) ([]ParsedDiff, error) { | ||
| rangeArg := commit1 + "^.." + commit1 |
There was a problem hiding this comment.
Handle root commits in single-commit diff generation
The single-commit path builds commit^..commit, which fails for root commits because they do not have a parent. In repositories with one commit, or when users select the first commit in history, this returns a git error instead of showing the commit’s changes.
Useful? React with 👍 / 👎.
| if m.section == secHistory { | ||
| if len(m.commits) == 0 { |
There was a problem hiding this comment.
Render selected commit diffs in history mode
Pressing Enter in history mode loads a commit diff into selectedDiffs, but View() always renders the commit list whenever m.section == secHistory. That means the loaded diff is never shown in the TUI, so the history “select commit” flow does not actually display commit content.
Useful? React with 👍 / 👎.
| parts := strings.Split(strings.TrimPrefix(r.URL.Path, "/diff/branch/"), "/") | ||
| if len(parts) < 2 { |
There was a problem hiding this comment.
Stop splitting branch refs from slash-delimited path segments
This endpoint splits /diff/branch/... by / and only uses parts[0] and parts[1], which breaks common branch names containing slashes (for example feature/foo). Requests with such names are misparsed into wrong refs and produce incorrect diffs or git errors.
Useful? React with 👍 / 👎.
No description provided.